<?php
//
// +------------------------------------------------------------------------+
// | PHP Version 5.4                                                        |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | 世纪车来车往(北京）网络科技有限公司 版权所有！                         |
// | TEL:010-63732365  HOTLINE:400-6688-365  EMAIL:clcw@clcw.com.cn         |
// | $Revision: 1.0 $                                                       |
// +------------------------------------------------------------------------+
// | Author: songaimin@clcw.com.cn  Blog:http://blog.csdn.net/samxx8        |
// +------------------------------------------------------------------------+
//

namespace AuctionCore\System;

/**
* 系统配置类
* @author   sam 
*/
class SystemConf {

    /**
     * 获取系统配置
     * @param $name
     * @return bool|mixed
     */
    public static function getConfByName($name)
    {
        if(empty($name)){
           return false;
        }
        return  M("setting")->where(['name'=>trim($name)])->find();
    }
    
    /**
     * 更新系统配置
     */
    public static function updateConfByValue($name,$value)
    {
        if(empty($name) || empty($value)){
            return false;
        }
        return M('setting')->where(['name'=>trim($name)])->save(['value'=>$value]);
    }
}